package com.lgc.javathread.threadPoolTest.threadproject;

/**
 * Created by Administrator on 2018/3/24.
 */
public class MyRunnable implements Runnable { //1,定义一个类实现Runnable
    @Override
    public void run() {             //2,重写run方法
//        for(int i = 0; i < 1000; i++) {      //3,将要执行的代码写在run方法中
//            System.out.println("aaaaaaaaaaaa");
//        }

        int index =0;
        while (true)
        {
            index++;
            if(index>=200)
            {
                break;
            }
            System.out.println("循环 " +String.valueOf(index));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
